using GraphQL.Types;
using GraphQLDemo.Domain;

namespace GraphQLDemo.Api.GroupTypes;

public class ContractItemGraphType : ObjectGraphType<ContractItem>
{
    public ContractItemGraphType()
    {
        Name = "contractItem";
        Description = "contract item test ... ";

        Field<DateTimeGraphType>("creationtime")
            .Resolve(context =>
            {
                return DateTime.Now;
            });
        Field<StringGraphType>("content")
            .Resolve(context =>
            {
                context.Source.Content = "eventlog content";
                return context.Source.Content;
            });
    }
}